﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI.WebControls;

/// <summary>
/// http://weblogs.asp.net/reganschroder/archive/2008/01/22/remove-border-width-0px-from-asp-image-or-asp-imagebutton.aspx
/// Summary description for ImageControl
/// </summary>
public class BorderlessImage : Image
{

    public override Unit BorderWidth
    {

        get
        {

            if (base.BorderWidth.IsEmpty)

                return Unit.Pixel(0);

            else

                return base.BorderWidth;

        }

        set
        {

            base.BorderWidth = value;

        }

    }

}


public class BorderlessImageButton : ImageButton

{

    public override Unit BorderWidth

    {

        get

        {

            if (base.BorderWidth.IsEmpty)

            return Unit.Pixel(0);

        else

            return base.BorderWidth;

        }

        set

        {

            base.BorderWidth = value;

        }

    }

}